package com.taojiazheng.common;

import java.util.List;

/**
 * @author 赵成林
 * @date 2017/11/22 20:43
 * 统一返回结果
 */
public class ResultResponse<T> {
    /**
     * 返回的状态码
     */
    private Integer code = 0;
    /**
     * 返回的信息
     */
    private String string = "success";
    /**
     * 返回的具体内容
     */
    private T data;
    /**
     * 返回的具体内容的列表
     */
    private List<T> list;

    public ResultResponse(T data){
        this.data = data;
    }
    public ResultResponse(){

    }
    public ResultResponse(Integer code,String string){
        this.code = code;
        this.string = string;
    }
    public ResultResponse(List<T>list){
        this.list = list;
    }

    public Integer getCode() {
        return code;
    }

    public String getString() {
        return string;
    }

    public T getData() {
        return data;
    }

    public List<T> getList() {
        return list;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setString(String string) {
        this.string = string;
    }

    public void setData(T data) {
        this.data = data;
    }

    public void setList(List<T> list) {
        this.list = list;
    }
}
